#include <iostream>
#include <string>
#include <vector>
#include <functional>

void print(const std::string &str, const int num)
{
    std::cout << str << " " << num << std::endl;
}

int main()
{
    print("hello world", 10);
    auto func1 = std::bind(print, "nihao shijie", 20);
    func1();
    auto func2 = std::bind(print, "你好,世界", std::placeholders::_1);
    func2(30);

    typedef std::function<void()> Task;
    std::vector<Task> array;
    array.push_back(std::bind(print, "hello world", 1));
    array.push_back(std::bind(print, "nihao shijie", 2));
    array.push_back(std::bind(print, "你好,世界", 3));

    for (auto &func : array)
    {
        func();
    }
    return 0;
}